package com.lbssoft.gpsbd.common;

import com.lbssoft.gpsbd.controller.WebSocket;
import com.lbssoft.gpsbd.model.SocketMsg;

import java.io.IOException;

/**
 * Created by nczc on 2018/3/30.
 */
public class WebSocketMessage {
    public static void send(SocketMsg msg,long userId){
        for(WebSocket item : WebSocket.clients()){
            try {
                if(item.getUserId()==userId){
                    item.sendMessage(msg);
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
